#ifndef __M_IMAGE_VIEW_H__
#define __M_IMAGE_VIEW_H__

#include "gui/gui.h"

enum ImageViewScaleType
{
    TYPE_IMAGE_SCALE_CENTER,
    TYPE_IMAGE_SCALE_CENTER_CROP,
    TYPE_IMAGE_SCALE_CENTER_INSIDE,
    TYPE_IMAGE_SCALE_FIT_XY,
    TYPE_IMAGE_SCALE_FIT_START,
    TYPE_IMAGE_SCALE_FIT_END,
    TYPE_IMAGE_SCALE_FIT_CENTER,
    TYPE_IMAGE_SCALE_FIT_CENTER_CROP,
    TYPE_IMAGE_SCALE_FIT_CENTER_INSIDE,
    TYPE_IMAGE_SCALE_MATRIX,
};

typedef View ImageView;

#define ImageViewSetLayoutGravity(imageView, gravity) ViewSetLayoutGravity(imageView, gravity)
#define ImageViewGetLaoyoutGravity(imageView) ViewGetLaoyoutGravity(imageView)

#define ImageViewSetLayoutMargin(imageView, left, right, top, bottom) ViewSetLayoutMargin(imageView, left, right, top, bottom)
#define ImageViewGetLayoutMargin(imageView, left, right, top, bottom) ViewGetLayoutMargin(imageView, left, right, top, bottom)

#define ImageViewSetLayoutSize(imageView, layout_w, layout_h) ViewSetLayoutSize(imageView, layout_w, layout_h)
#define ImageViewGetLayoutSize(imageView, layout_w, layout_h) ViewGetLayoutSize(imageView, layout_w, layout_h)

#define ImageViewSetLayoutAvailableSize(imageView, available_w, available_h) ViewSetLayoutAvailableSize(imageView, available_w, available_h)
#define ImageViewGetLayoutAvailableSize(imageView, available_w, available_h) ViewGetLayoutAvailableSize(imageView, available_w, available_h)

#define ImageViewSetLayoutPosition(imageView, layout_x, layout_y) ViewSetLayoutPosition(imageView, layout_x, layout_y)
#define ImageViewGetLayoutPosition(imageView, layout_x, layout_y) ViewGetLayoutPosition(imageView, layout_x, layout_y)

#define ImageViewSetVisibility(imageView, visibility) ViewSetVisibility(imageView, visibility)
#define ImageViewGetVisibility(imageView) ViewGetVisibility(imageView)

#define ImageViewSetOrientation(imageView, orientation) ViewSetOrientation(imageView, orientation)
#define ImageViewGetOrientation(imageView) ViewGetOrientation(imageView)

#define ImageViewSetGravity(imageView, gravity) ViewSetGravity(imageView, gravity)
#define ImageViewGetGravity(imageView) ViewGetGravity(imageView)

#define ImageViewSetPadding(imageView, left, right, top, bottom) ViewSetPadding(imageView, left, right, top, bottom)
#define ImageViewGetPadding(imageView, left, right, top, bottom) ViewGetPadding(imageView, left, right, top, bottom)

#define ImageViewSetAutoFree(imageView, auto_free) ViewSetAutoFree(imageView, auto_free)
#define ImageViewIsAutoFree(imageView) ViewIsAutoFree(imageView)

#define ImageViewSetFocus(view, focused) ViewSetFocus(view, focused)
#define ImageViewIsFocused(view) ViewIsFocused(view)

#define ImageViewSetBgColor(imageView, color) ViewSetBgColor(imageView, color)
#define ImageViewGetBgColor(imageView) ViewGetBgColor(imageView)

#define ImageViewSetUserData(imageView, data) ViewSetUserData(imageView, data)
#define ImageViewGetUserData(imageView) ViewGetUserData(imageView)

#define ImageViewGetMeasuredSize(imageView, measured_w, measured_h) ViewGetMeasuredSize(imageView, measured_w, measured_h)
#define ImageViewGetWrapSize(imageView, wrap_w, wrap_h) ViewGetWrapSize(imageView, wrap_w, wrap_h)
#define ImageViewGetOccupySize(imageView, occupy_w, occupy_h) ViewGetOccupySize(imageView, occupy_w, occupy_h)
#define ImageViewGetMeasuredContentSize(imageView, measured_content_w, measured_content_h) ViewGetMeasuredContentSize(imageView, measured_content_w, measured_content_h)
#define ImageViewGetWrapContentSize(imageView, wrap_content_w, wrap_content_h) ViewGetWrapContentSize(imageView, wrap_content_w, wrap_content_h)

int ImageViewSetScaleType(ImageView *imageView, int type);
int ImageViewGetScaleType(ImageView *imageView);

int ImageViewSetTintColor(ImageView *imageView, uint32_t color);
uint32_t ImageViewGetTintColor(ImageView *imageView);

int ImageViewSetTexture(ImageView *imageView, const GUI_Texture *texture);
const GUI_Texture *ImageViewGetTexture(ImageView *imageView);

ImageView *NewImageView();
int ImageViewInit(ImageView *imageView);
int ImageViewDeinit(ImageView *imageView);
int ImageViewDestroy(ImageView *imageView);
int ImageViewMeasure(ImageView *imageView);
int ImageViewDraw(ImageView *imageView);

#endif
